home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
Virtual User 1.0
/
Example Scripts
/
MessagePassing Example
/
Actor1.vu
next >
Wrap
Text File
|
1991-01-25
|
2KB
|
49 lines
#
# File: actor1.vu
#
# Contains: This is a demo script which runs in parallel with the script
# actor2.vu. They together demonstrate message passing while
# sharing tasks in a library. To run this demo you need two
# target machines (both having the Desk Accessory, Key Caps).
# It would be better if the two targets had different memory
# configurations and are running different versions of system software.
# Your command line should be as follows: (assuming the two
# targets have user names as Target1 and Target2 and that
# Actor1.vu, Actor2.vu and the library MessagePassingDemoLib.vu
# are all in your current working directory)
# VU -t1 '*:Target1' -s1 Actor1.vu -l1 Actor1.log ∂
# -t2 '*:Target2' -s2 Actor2.vu -l2 Actor2.log
#
# Caution: Do not forget to turn the key repeat off in the control panel on both
# the targets. The script takes a few seconds before you start seeing
# anything on the target screens.
#
# Written by: P Nagarajan
#
# Copyright: © 1990 by Apple Computer, Inc., all rights reserved.
#
# Change History:
#
# 8/16/90 naga creation
#
# To Do:
#
Libraries "MessagePassingDemoLib.vu";
actorName("Actor1");#set name for self to Actor1, the main actor
other_actors := {};
wait(2);#wait is required to make sure that the other actor(s)
#have finished changing their names before we do a collect
all_actors := collect[actor];
for each a in all_actors
begin
if a.t <> "Actor1"
other_actors := other_actors + {a};
end;#for each
#remove self from all actors list
open_session(other_actors[1]); #pick the first actor and open a session
send(other_actors[1], {"Start"});
run_demo(other_actors[1]);
closeSession(other_actors[1]);